package me.firstapp.service.shop.impl;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import me.firstapp.common.exception.ServiceException;
import me.firstapp.common.exception.StatusHouse;
import me.firstapp.common.utils.Page;
import me.firstapp.module.shop.OrderItem;
import me.firstapp.repository.shop.OrderItemRepository;
import me.firstapp.service.shop.OrderItemService;

@Service
public class OrderItemServiceImpl implements OrderItemService {

	@Autowired
	private OrderItemRepository orderItemRepository;

	@Override
	public Page<OrderItem> findOrderItemPage(Integer pageNo, Integer pageSize, Map<String, Object> searchParams,
			String sortParam, String sortType, Long orderId) {
		if (orderId == null) {
			throw new ServiceException(StatusHouse.COMMON_STATUS_PARAM_REQUIRED_ERROR, "订单id");
		}
		return orderItemRepository.findOrderItemPage(pageNo, pageSize, searchParams, sortParam, sortType, orderId);
	}

}
